<?php
require_once 'Zend/Loader.php';
require_once 'Zend/Loader.php';
require_once 'application/constant/constant.php';

/** 
 * controllerFront
 * @author    Soochow University
 * @version   1.0
 * @exclude   作  成  日：2011/04/07
 */
class controllerFront{
    
    /**
     * controllerFront
     */
    private $controllerFront;
    
    /**
     * __construct
     */
    public function __construct(){
        Zend_Loader::loadClass('Zend_Controller_Front');
        $this->controllerFront=Zend_Controller_Front::getInstance();
        $this->controllerFront->setModuleControllerDirectoryName(sysConstant::MODULE_DIRECTORY_NAME);
    }
    
    /**
     * 模块目录
     * moduleDirectory
     */
    public function moduleDirectory(){
        $this->controllerFront->addModuleDirectory(sysConstant::MODULES_PATH);
    }
    
    /**
     * 设置不使用ZF默认视图
     * setViewRenderer
     */
    public function setViewRenderer(){
        $this->controllerFront->setParam('noViewRenderer', true);
    }
    
    /**
     * 分派模块
     * dispatch
     */
    public function dispatch(){
        $this->controllerFront->dispatch();
    }
}
